import React from 'react';
import { Collapse, Input, Button, Card, Row, Col, Alert } from 'antd';

const { Panel } = Collapse;

// types.ts
export interface Model {
    name: string;
    enabled: boolean;
    messages: { model: string; role: string; content: string }[]; // 确保messages符合这个结构
}



// 定义 ModelChat 组件的 Props 类型
// ModelChat.tsx
interface ModelChatProps {
    model: string;
    enabled: boolean;
    messages: { model: string; role: string; content: string }[]; // content 是 string 类型
    sendMessage: (type: string, payload: { model: string; enabled: boolean }) => void;
    allAtOnce: boolean;
    onSendMessage: (assistantMessage: { model: string; text: string }, sourceModel: string) => void;
    models: Model[];
}



const ModelChat: React.FC<ModelChatProps> = ({ model, enabled, messages, onSendMessage }) => {
    return (
        <div>
            <h3>{model}</h3>
            {messages.map((message, index) => (
                <div key={index}>
                    <p>{message.model} ({message.role}): {message.content}</p>
                </div>
            ))}
        </div>
    );
};


export default ModelChat;
